using UnityEngine;
using UnityEngine.EventSystems;

public class TapControlPanel : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler, IPointerExitHandler
{
	private TapControl tapControl;

	private void Start()
	{
		tapControl = Object.FindObjectOfType<TapControl>();
	}

	public void OnPointerDown(PointerEventData eventData)
	{
		if ((bool)tapControl)
		{
			tapControl.valid = true;
			tapControl.pressed = true;
		}
	}

	public void OnPointerUp(PointerEventData eventData)
	{
		if ((bool)tapControl)
		{
			tapControl.pressed = false;
		}
	}

	public void OnPointerExit(PointerEventData eventData)
	{
		if ((bool)tapControl)
		{
			tapControl.pressed = false;
		}
	}
}
